<template>
  <view>
    <view class="mt-4" v-for="(group, i) in groupList" :key="i">
      <view class="pa-3 fz-14 op-6" v-if="group.title">{{ group.title }}</view>
      <q-list :list="group.list" arrow @item="onItem"></q-list>
    </view>
  </view>
</template>

<script>
  import {
    mapState
  } from "vuex";

  export default {
    computed: {
      ...mapState({
        inSdk: (s) => s.sysInfo.inSdk,
      }),
      groupList() {
        let groups = [

        ];
        if (!this.inSdk) {
          groups.unshift({
            list: [{
              title: "小程序设置",
              openType: "openSetting",
            }, ],
          });
        }
        // 切换账号
        return groups;
      },
    },
    data() {
      return {};
    },
    methods: {
      onItem(it) {
        if (it.openType) return;
        if (it.link) {
          this.$navTo(it.link, {
            title: it.title
          });
        }
      },
    },
  };
</script>